/**
 * @description 个人动态表
 */

const seq = require('../seq')
const { INTEGER, STRING, JSON } = require('../types')

const Opinion = seq.define('opinion', {
  content: {
    type: STRING,
    allowNull: false,
    comment: '动态内容',
  },
  imgUrls: {
    type: JSON,
    comment: '图片地址的字符串数组。格式：["xxx", "xxx", ...]'
  },
  releaseProvinceId: {
    type: INTEGER,
    comment: '发布时所选的省份。默认：如果未选，就用个人所在省份',
  },
  releaseCityId: {
    type: INTEGER,
    comment: '发布时所选的城市。默认：如果未选，就用个人所在城市',
  },
  
  // Sequelize 自动创建的外键：
  // userId 用户 ID
}, {
  paranoid: true,
})

module.exports = Opinion
